package org.study.mybatisplus.dynamic.boot.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.web.multipart.MultipartFile;
import org.study.mybatisplus.dynamic.boot.dto.*;
import org.study.mybatisplus.dynamic.boot.model.IotLog;
import org.study.mybatisplus.dynamic.boot.vo.*;

import java.util.List;
import java.util.Map;

/**
 * 设备管理
 *
 * @author doveylovey
 * @version v1.0.0
 * @email 1135782208@qq.com
 * @date 2024年10月08日
 */
public interface DeviceService {
    boolean deviceSave(DeviceSaveDTO deviceSaveDTO);

    boolean deviceRemove(long id);

    IPage<DeviceVO> deviceList(Page<DeviceVO> page, Long projectId, String deviceName);

    DeviceVO deviceDetail(Long deviceId);

    boolean property2Tsdb1(Long deviceId);

    boolean property2Tsdb2(Long deviceId);

    boolean devicePropertySave(DevicePropertySaveDTO devicePropertySaveDTO);

    boolean devicePropertyRemove(IdAuthDTO idAuthDTO);

    IPage<DevicePropertyVO> devicePropertyList(Page<DevicePropertyVO> page, Long deviceId, String propertyName);

    boolean deviceImport(Long projectId, Long powerStationId, MultipartFile excelFile);

    boolean propertyImport(Long deviceId, MultipartFile excelFile);

    List<DevicePropertyExportVO> exportDeviceProperty(Long deviceId);

    boolean createAlarmConfig4AllDevice();

    List<QueryCurrentValueVO> queryCurrentValue(QueryCurrentValueDTO queryCurrentValueDTO);

    QueryHistoryValueVO queryHistoryValue(QueryHistoryValueDTO queryHistoryValueDTO);

    void exportHistoryValue(HttpServletResponse response, QueryHistoryValueDTO queryHistoryValueDTO);

    IPage<IotLog> logList(Page<IotLog> page, Long projectId, Long deviceId, String startTime, String endTime);

    Map<String, String> productCount(Long projectId);

    Map<String, String> deviceMsg(Long projectId, Long deviceId);
}
